# -*- coding: utf-8 -*-

'''
Class HTML - Generate Html code
Classe HTML - Gera código Html
@author - David Guerreiro - Nº4903
data: 17- JUL -2011
'''
import os

class HTML:

    ## method used to write html of List 1
    ## metodo utilizado para escrever em html da Lista 1
    def write_html1(self, data):

        self.d = data
        condicion = os.path.isfile("./HTML/list1.html")

        if condicion == True:
            file = open("./HTML/list1.html", "a")
            file.write('<h6>{0}</h6>\n'.format(self.d))
        else:
            file = open("./HTML/list1.html", "a")       
            file.write('<html>')
            file.write('<head>')
            file.write('<title>Listagens 1</title><meta http-equiv="Content-Type" content="text/html; charset="utf-8">'.format(self))
            file.write('</head>')
            file.write('<link REL=STYLESHEET HREF="../../HTML/Style.css" Type="text/css">')
            file.write('</head>')
            file.write('<body>')
            file.write('<div id="header">')
            file.write('<h1>Sistema Rebides</h1>')
            file.write('<h2>Listagens 1</h2>')
            file.write('</div>')
            file.write('<div id="content">')

    ## method used to write html of List 2
    ## metodo utilizado para escrever em html da Lista 2
    def write_html2(self, data):

        self.c = data
        condicion = os.path.isfile("./HTML/list2.html")

        if condicion == True:
            file = open("./HTML/list2.html", "a")
            file.write('<h6>{0}</h6>\n'.format(self.c))
        else:
            file = open("./HTML/list2.html", "a")       
            file.write('<html>')
            file.write('<head>')
            file.write('<title>Listagens 2</title><meta http-equiv="Content-Type" content="text/html; charset="utf-8">'.format(self))
            file.write('</head>')
            file.write('<link REL=STYLESHEET HREF="../../HTML/Style.css" Type="text/css">')
            file.write('</head>')
            file.write('<body>')
            file.write('<div id="header">')
            file.write('<h1>Sistema Rebides</h1>')
            file.write('<h2>Listagens 2</h2>')
            file.write('</div>')
            file.write('<div id="content">')

    ## method used to write html of List 3
    ## metodo utilizado para escrever em html da Lista 3
    def write_html3(self, data):

        self.c = data
        condicion = os.path.isfile("./HTML/list3.html")

        if condicion == True:
            file = open("./HTML/list3.html", "a")
            file.write('<h6>{0}</h6>\n'.format(self.c))
        else:
            file = open("./HTML/list3.html", "a")       
            file.write('<html>')
            file.write('<head>')
            file.write('<title>Listagens 3</title><meta http-equiv="Content-Type" content="text/html; charset="utf-8">'.format(self))
            file.write('</head>')
            file.write('<link REL=STYLESHEET HREF="../../HTML/Style.css" Type="text/css">')
            file.write('</head>')
            file.write('<body>')
            file.write('<div id="header">')
            file.write('<h1>Sistema Rebides</h1>')
            file.write('<h2>Listagens 3</h2>')
            file.write('</div>')
            file.write('<div id="content">')
    
pass
